﻿using aier.dataaccess.dapper;
using aier.dataaccess.model;
using aier.wx.nosql.redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.business.logic
{
    public class ScreenTypeBll
    {
        public XrmOptionDal xrmOptionDal { get; set; }
        public RedisTestDal redisTestDal { get; set; }

        public List<XrmOption> GetScreenTypes() {
            List<XrmOption> result = null;
            result = redisTestDal.Get<List<XrmOption>>("new_screenNew_screentype");

            if (result != null && result.Count() > 0)
            {
                return result;
            }
            else
            {
                result = xrmOptionDal.GetXrmOptionByEntity("new_screen", "new_screentype").ToList();
                redisTestDal.Set<List<XrmOption>>("new_screenNew_screentype", result);
            }
            return result;
        }


    }
}
